import request from '@/config/axios'

export interface MarketingShippingNoteVO {
  type: number
  data: MarketingShippingNoteList[]
}

interface MarketingShippingNoteList {
  id: number
  orderNumber: string
  dictOrderType: number
  customerName: string
  productNumber: string
  productName: string
  partNumber: string
  partName: string
  orderQuantity: number
  dictStatus: number
  creatorName: string
}

// 查询订单管理-营销管理-发货通知单列表
export const getMarketingShippingNotePage = async (params) => {
  return await request.get({ url: `/order/marketing-shipping-note/page`, params })
}

// 查询订单管理-营销管理-发货通知单详情
export const getMarketingShippingNote = async (id: number) => {
  return await request.get({ url: `/order/marketing-shipping-note/get?id=` + id })
}

// 保存提交订单管理-营销管理-发货通知单
export const saveAndHandleMarketingShippingNote = async (data: MarketingShippingNoteVO) => {
  return await request.post({ url: `order/marketing-shipping-note/save-submit`, data })
}

// 导出订单管理-营销管理-发货通知单 Excel
export const exportMarketingShippingNote = async (data) => {
  return await request.download({ url: `/order/marketing-shipping-note/export-excel`, data })
}

// 撤回订单管理-营销管理-发货通知单
export const revocationMarketingShippingNote = async (id: number) => {
  return await request.put({ url: `/order/marketing-shipping-note/revocation?id=${id}` })
}